Part Number Hot Search : 
T1300 1PTC1 2SK26 2SK26 SCDS64B TN100 2M10V T1300
Product Description
Full Text Search
 

To Download AN676 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  battery charger using the st6-realizer ? by lionel picandet introduction because competition becomes greater and greater it is important to reduce time to market. the st6 realizer helps to fullfill this duty. the time needed to realize a design is dramatically reduced. design of an application takes a few days instead of a few weeks. users who develop st6 applications are systems electronics engineers; often they do not know the assembler well and there are reluctant to use it. the st6 realizer allows users to design their applications using symbols known by hardware designers such as comparators, counters, multiplexers. once the design is over, the st6 realizer generates assembly code or executable code for the different st6 target hardware. AN676/0395 1/14 application note
application note goal this note aims at introducing the different features of the st6 realizer graphic tool. it is also a tutorial to firstly help you get started with st6 realizer design, then for you to implement advanced features to optimize your design or to evaluate the target hardware requirements. the application note describes a battery charger because it illustrates the different features of the st6 realizer throughout it. the charger implements a simple charging method. nevertheless charging end points using the negative voltage slope detection method or voltage inflection points can be implemented with this battery charger st6 board. hardware schematics the schematics describes the different hardware parts of the application: the microcontroller connections the power supply the charging indicators the start push button the power command battery charger using the st6-realizer 2/14
figure 1 : simple battery charger circuit schematic battery cell: aa type / 1.2v - 0.5ah vcc u1 7805 j1 jack gnd power supply c1 22mf gnd gnd start ready led_hi led_lo dischrg vcc vdd 1 timer 2 oscin 3 oscout 4 nmi 5 test 6 reset/ 7 pb7 8 pb6 9 pb5 10 pb4 11 pb3 12 pb2 13 pb1 14 pb0 15 pa3 16 pa2 17 pa1 18 pa0 19 vss 20 u2 st6210 vcc 100k gnd xt1 8mhz-xt-p gnd c2 10pf c3 10pf gnd current voltage gnd c4 1mf imax st6210/20 mcu high low start sw1 gnd start push-button charge current indicator ld1 led-red-5mm ld2 led-red-5mm r1 470 r2 470 led_hi led_lo ready ld3 led-red-5mm r7 470 gnd t3 bd236-pnp-45v vcc r10 470 high low t1 r8 470 r2 68 ohms r6 2 ohms rv1 50k-rv imax gnd max current adjust bt1 battery nicd battery voltage current gnd r4 10 ohms note that in the circuit diagram the microcontroller is shown as a simple box. the objective of the st6 realizer is to enable you to write the program code for the microcontroller with the same ease and in the same manner as you have drawn the hardware schematic. battery charger using the st6-realizer 3/14
figure 2 : functional diagram start ready high low high charge low charge imax icharge vcharge mcu the mcu manages all the functions of the application: at reset the ready led blinks to indicate that the charger is ready to charge. the user pushes the start button to begin the high charge. the ready led switches off. the high led highlights. the low charge takes place when the voltage threshold of 1.5 v is reached. the high led switches off. the low led switches on. the battery charge is over when the delay of low charge is reached. the low led switches off. the ready led blinks. when the current in the battery is too high, high charge or low charge are bypassed. battery charger using the st6-realizer 4/14
figure 3 : flow chart start high charge voltage > 1,5v low charge current too high no no yes yes charging time expired current too high no yes no battery charger using the st6-realizer 5/14
hardware resources the application can run in stand-alone mode using an st6215 microcontroller. it can be driven by the st622x, st624x, st626x starter kit. the microcontroller requires: 3 analog inputs for: imax: the maximum current icharge: the charging current vcharge the actual voltage at the + connection of the cell a digital input to connect the start push button 2 digital outputs to switch the low charge current and the high charge current 3 digital outputs to switch the three leds that supply the user with information status software design the flow chart is implemented in the schematic editor of the realizer as a state machine. figure 4 : state machine the state machine sums up the behaviour of the application. due to the fact that the st6 realizer is a graphic tool, it is easy to explain how the application works with symbols and state machines. symbols named condition are events that allow the switching from state to state. the condition symbols are connected either to an external input (start, currenttoohigh, voltage>1.5v) or to internal outputs (chargingtimeexpired). symbols named state are linked to actions. in this application: high state starts high charging current and switches on high level status led low state starts low charging current and switches on low level status led ready state indicates by blinking an led that the charge is over or the application is waiting for a new battery to be charged. battery charger using the st6-realizer 6/14
software schematics internal output & internal input condition external input conditions external output actions figure 5 : internal output & internal input condition figure 6 : external input conditions battery charger using the st6-realizer 7/14
figure 7 : external output actions selecting the i/o symbols such as digin, digout or adc are connected to i/o pin ports. by selecting the target hardware and by double clicking on the symbol it is possible to assign a pin port to this symbol and to program it respectively as a digital input, a digital output or an analog input. the realizer process it is of interest to know how the st6 realizer works to avoid misunderstandings about the design application . here is how the realizer builds up its code: general definitions, like device name, registers reset entry initialisation of the port registers according to the connections made in the st6 realizer create backup register for output ports initialisation of the ad converter initialisation of the timer for the 10 ms tick initialisation of the ram used by the realizer application. call symbols initialisation macros start of the main loop (realmain) restart the ad converter when it is ready read the number of 10ms ticks and copy them for use by the st6 realizer application call symbol main macros, first all input symbol macros then all onormalo symbol macros and finally the output symbol macros. battery charger using the st6-realizer 8/14
call state machine macros call edge-sensitive input macros copy the backup values to the output ports trigger the watchdog if this option is enabled jump to the start of the loop (realmain) ad converter interrupt routine timer 10ms interrupt routine interrupt vector table generating code before generating the st6 program code it is necessary to define the target hardware where the executable code will be loaded. the st6210 microcontroller suits the application well. then the analyse step is run with all the selected options to get the executable code. debugging the application once the design of the application is over, the the executable code is available. the next step is to verify that the design corresponds to the design specifications. the validation of the design is made with the simulator. in the application state machine items are involved with the inputs and outputs of the system. the way to debug the application is to verify that each condition activates the corresponding state machine. figure 8 : debugging scheme with the simulator battery charger using the st6-realizer 9/14
the external inputs of the system are connected to adjusters. in this way it is easy to activate the system. numeric adjusters are used to get fixed input values. it is forbiden to put probes on the state machine, however they can be put on the statein and stateout symbols. at reset it is interesting to set adjusters to inactive values and to verify that the application states are inactive but the initial state. then adjusters are activated with fixed values so that the system can react to external stimulation. at this point it is useful to choose the step by step mode to detect spurious state transitions and to verify state sequences. it is advised to use host time instead of target time for time transitions because it takes less time. but for benchmark timing it is more convenient to choose the target time to keep the compatibility between instruction execution and time calculation. this information is given by the information loop box. once the schematics has been tested, the executable code can be programmed into an eprom-based version of the st6 microcontroller using the st6 starter kits or eprom programmers. battery charger using the st6-realizer 10/14
hardware constraints it is found that the real application in stand alone mode does not work as well as the simulated application. the battery charge goes directly into low level current without charging the battery. the problem is identified as coming from voltage fluctuations . the first solution the first solution considered was to average the adc values to decrease the influence of the voltage fluctuations. the average is designed in the figure below : figure 9 : averaging scheme it takes four loops before the adc voltage can be correctly averaged every loop. the input of the first add2 symbol must be cast to uint type because the output can be superior to an ubyte type. this way the uint type is expanded to all following symbols. in real terms it takes less than 1ms to run a loop. so it takes less than 4 ms to get a correct average voltage. in addition the start push button must not be pressed while the average is not stabilized. the schematic design for the average is quite large. as it must be implemented on the adc that converts the charging current and the voltage, the root scheme drawing will be overloaded with symbols and be confusing to read. on the other hand, the implementation of these adc converters is memory consuming. these drawbacks have been solved by creating sub-schemes. the figure below shows the use of sub-schemes: battery charger using the st6-realizer 11/14
figure 10 : use of sub-schemes the output of the sub-scheme symbol is cast to ubyte type because the average result fits to the values of an unsigned byte. in addition it is not worth keeping uint 16-bit type because it wastes ram memory. inside the sub-scheme the treatment of the average looks like this: figure 11 : a generic averaging sub-scheme the symbols portin and portout allow the sub-scheme to be link ed to the root scheme. the label of portin and portout must match the names of the sub-scheme symbol. while adc values were averaged the behaviour of the real application were the same.the high current charge did not occur. second solution the use of a numeric oscilloscope proves that the problem came from voltage fluctuations that occur during the establishment of the high current charging circuit. this problem is solved by adding a new state to invalidate the voltage threshold during the setup time of the high current charge. the new state is connected to a fixed timer whose duration is the setup time of the high current charge. battery charger using the st6-realizer 12/14
conclusion the st6 realizer is a powerful graphic tool that aims at designing software without requiring knowledge of assembly language. it uses symbols that hardware designers know well. another advantage is that users can develop their application independently from the hardware board. the st6 simulator is included in the st6 realizer, so that users can validate their design without the st6 board. many applications in automotive and home appliances can be developped with the st6 realizer. battery charger using the st6-realizer 13/14
notes: information furnished is believed to be accurate and reliable. however, sgs-thomson microelectronics assumes no responsability for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of sgs-thomson microelectronics. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. sgs-thomson microelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of sgs-thomson microelectronics. ? 1995 sgs-thomson microelectronics - all rights reserved purchase of i2c components by sgs-thomson microelectronics, conveys a license under the philips i2c patent. rights to use these components in an i2c system, is granted provided that the system conforms to the i2c standard specifications as defined by philips. sgs-thomson microelectronics group of companies australia - brazil - china - france - germany - hong kong - italy - japan - korea - malaysia - malta - morocco the netherlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. battery charger using the st6-realizer 14/14


▲Up To Search▲   

 
Price & Availability of AN676

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X